<template>
	<view class="">
		<view class="comtop">
			<view class="comtxt">
				入驻企业列表
			</view>
			<img src="https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/enterprise_base_logo.png"  alt="" style="height: 80%;width: 60%;margin-top: 40rpx;" />
		</view>
		<view class="com-contain" v-for="(item,index) in comlist" :key="item.id" @click=navToinfo(item)>
			<view class="com-avatar">
				<image :src="item.cloge ? item.cloge : 'http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/default-avatar.png'" mode="" style="width: 100%; height: 100%;"></image>
			</view>
			<view class="com-containtxt">
				<view class="tptxt"><text>{{item.cname}}</text><view class="aut">认证</view></view>
				<text class="bmtxt">{{item.cnature?item.cnature:''}} {{item.cindustry? '|' : ''}} {{item.cindustry?item.cindustry:''}} {{item.remark1? '|' : ''}} {{item.remark1?item.remark1:''}}</text>
			</view>
		</view>
		<!-- <view v-if="!isonReachBottom"  style="text-align: center; color: #333; line-height: 100rpx; background: #f3f3ff;">没有更多了...</view> -->
	</view>
	
</template>

<script>
	//已注册企业
	import Index from "@/common/index-model.js"	
	import fun from '@/common/publicFun.js'
	let index = new Index()
	let that = null
	export default {
		data() {
			return {
				comlist:[],
				ps:10,
				pn:0,
				isonReachBottom:true
			}
		},
		onLoad() {
			this.getcompany()
		},
		onPullDownRefresh() {
			this.getcompany()
		  },
		onReachBottom() {
			if(this.isonReachBottom&&this.comlist.length >= 10){
				console.log(this.isonReachBottom)
				this.getcompany()
			}
			
		},
		methods: {
			//页面跳转
			navToinfo(e) {
				let cominfo = JSON.stringify(e);
				index.navigate_to(`/pagesC/compyinfo/index?index=` + cominfo)
			},
			getcompany(){
				index.getPublicUserMember({
					pageSize:this.ps,
					pageNo:this.pn
					// pageSize:100,
					//  pageNo:0,
				},'client/enterprise/info/getlist','get',res=>{
					if(res.data.code == 200 && res.data.success){
						console.log("请求数据->",res.data.result.records) 
						if(this.comlist.length != res.data.result.records.length){
							this.ps += 10
						}else{
							this.isonReachBottom = false
						}
						this.comlist = res.data.result.records
						uni.stopPullDownRefresh();
					}else{
						console.log("请求失败") 
						uni.stopPullDownRefresh();
					}
				})
				console.log("请求数据",this.comlist)
			},
		}
	}
</script>

<style>
	@import url("index.css");
	page{
		width: 100%;height: 100%;background-color: #efefef;
	}

</style>
